<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
      }

      body {
        width: 100vw;
        height: 100vh;
        background: #2c3e50;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      main {
        width: 300px;
        height: 300px;
        transform-origin: center center 100px;
        position: relative;
        transition: 2s;
        transform-style: preserve-3d;
        transform: perspective(900px) rotateX(-45deg);
      }

      body:hover main {
        transform: perspective(900px) rotateX(185deg) rotateY(150deg);
      }

      div {
        width: 200px;
        height: 200px;
        position: absolute;
        background: green;
        font-size: 3em;
        display: flex;
        justify-content: center;
        align-items: center;
        /* 正方体正中心为 中心转 */
        transform-origin: center center 100px;
        opacity: 0.8;
      }

      div:nth-child(1) {
        background: red;
        transform: rotateY(90deg);
      }

      div:nth-child(2) {
        background: blue;
        transform: rotateY(180deg);
      }

      div:nth-child(3) {
        background: yellow;
        transform: rotateY(270deg);
      }

      div:nth-child(4) {
        background: yellowgreen;
        transform: rotateY(360deg);
      }

      div:nth-child(5) {
        background: #000;
        transform-origin: top;
        transform: rotateX(90deg);
      }

      div:nth-child(6) {
        background: blueviolet;
        transform-origin: bottom;
        transform: rotateX(-90deg);
      }
    </style>
  </head>
  <body>
    <main>
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <div>4</div>
      <div>5</div>
      <div>后盾人</div>
    </main>
  </body>
</html>
